//
//  PCDApiSendSms.m
//  PCDMPaasBank
//
//  Created by DK on 2021/3/8.
//  Copyright © 2021 Alibaba. All rights reserved.
//

#import "PCDApiSendSms.h"

@implementation PCDApiSendSms

- (void)handler:(id)data andContext:(PCDContext *)context ResponseCallback:(WVJBResponseCallback )responseCallback
{
    NSDictionary *dict;
    if ([data isKindOfClass:[NSDictionary class]]) {
        dict = (NSDictionary*)data;
    }else{
        dict =(NSDictionary*)[data JSONValue];
    }
    
    NSString *phoneNo = [dict objectForKey:@"phoneNumber"];
    if (phoneNo) {
        NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"sms://%@",phoneNo]];
        [[UIApplication sharedApplication]openURL:url];
    }
}

@end
